package com.ipzoe.common.util;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import java.time.LocalDateTime;

/**
 * 基础实体类
 * <p>
 * Created on 2018/1/18.
 *
 * @author pfzhang
 */
@ApiModel(value = "BaseEntity", description = "基础实体类")
@Data
public class BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    protected Long id;

    /** 是否删除 */
    @ApiModelProperty("是否删除")
    private Boolean delFlag = Boolean.FALSE;

    /** 创建人 */
    @ApiModelProperty("创建人")
    protected String creator;

    /** 创建时间 */
    @ApiModelProperty("创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime createTime;

    /** 更新人 */
    @ApiModelProperty("更新人")
    protected String modifier;

    /** 最后更新时间 */
    @ApiModelProperty("最后更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    protected LocalDateTime modifyTime;
}
